﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using YArchitech.Revit;

namespace HYFloorPipeModule
{
	[Transaction(TransactionMode.Manual)]
	[Regeneration(RegenerationOption.Manual)]
	public class TestDrawSample : HYExternalCommand
	{
		public override Result HYExecute(ref string TranName)
		{
			TranName = "绘制图例";
			string[] names = new string[]
			{
				"旋转轴",
				"<房间分隔>",
				"<面积边界>",
				"线",
				"隐藏线",
				"细线"
			};
			Dictionary<int, string> dictionary = new Dictionary<int, string>();
			dictionary.Add(1, "DN80");
			dictionary.Add(2, "DN70");
			dictionary.Add(3, "DN50");
			dictionary.Add(4, "DN50");
			dictionary.Add(5, "DN70");
			dictionary.Add(6, "DN80");
			Dictionary<int, LevelMarkInfo> dictionary2 = new Dictionary<int, LevelMarkInfo>();
			Dictionary<int, string> dictionary3 = new Dictionary<int, string>();
			dictionary3.Add(1, "DN70");
			dictionary3.Add(2, "DN60");
			dictionary3.Add(3, "DN50");
			dictionary3.Add(4, "DN50");
			dictionary3.Add(5, "DN60");
			dictionary3.Add(6, "DN70");
			Dictionary<int, int> dictionary4 = new Dictionary<int, int>();
			dictionary4.Add(1, 1);
			dictionary4.Add(2, 1);
			dictionary4.Add(3, 2);
			dictionary2.Add(1, new LevelMarkInfo(3, dictionary3, dictionary4));
			dictionary2.Add(2, new LevelMarkInfo(3, dictionary3, dictionary4));
			dictionary2.Add(3, new LevelMarkInfo(3, dictionary3, dictionary4));
			HeatingPrincipleDiagramPrameters heatingPrincipleDiagramPrameters = new HeatingPrincipleDiagramPrameters();
			heatingPrincipleDiagramPrameters.isSameDisIn = true;
			heatingPrincipleDiagramPrameters.isSameDisOut = false;
			heatingPrincipleDiagramPrameters.stanPipeCount = 3;
			heatingPrincipleDiagramPrameters.dic = dictionary;
			heatingPrincipleDiagramPrameters.dicLevelMarkInfo = dictionary2;
			XYZ basepoint = base.Sel.PickPoint("选择一个插入点");
			new DrawSampleChart(base.Doc, base.Doc.ActiveView).DrawTheSampleChart(basepoint, names, heatingPrincipleDiagramPrameters);
			return Autodesk.Revit.UI.Result.Succeeded;
		}
	}
}
